﻿using System;

class Calculator
{
    private void calculate(int a, int b, char c)
    {
        int answer;
        switch (c)
        {
            case '+':
                answer = a + b;
                Console.Write(answer);
                break;
            case '-':
                answer = a - b;
                Console.Write(answer);
                break;
            case '*':
                answer = a * b;
                Console.Write(answer);
                break;
            case '/':
                answer = a / b;
                Console.Write(answer);
                break;
            default:
                Console.WriteLine("输入的运算符不标准");
                break;
        }
    }
    public static void Main()
    {
        Console.WriteLine("请输入第一个操作数：");
        string a = Console.ReadLine();
        int m = Int32.Parse(a);
        Console.WriteLine("请输入第二个操作数：");
        string b = Console.ReadLine();
        int n = Int32.Parse(b);
        Console.WriteLine("请输入操作符：");
        char c = (char)Console.Read();
        Console.WriteLine("结果为：");
        Calculator calculator = new Calculator();
        calculator.calculate(m, n, c);
    }
}